<template>
  <div class="app-container">
    <baidu-map
      id="allmap"
      :scroll-wheel-zoom="true"
      @ready="mapReady">
    </baidu-map>
    <!-- 添加或修改岗位对话框 -->
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="请输入上车地点" >
          <el-input v-model="form.postName" placeholder="请输入上车地点" />
        </el-form-item>
        <el-form-item label="请输入目的地" >
          <el-input v-model="form.postCode" placeholder="请输入目的地" />
        </el-form-item>
        <el-form-item label="请选择车型">
          <el-checkbox-group v-model="checkList">
            <el-checkbox label="特普快车"></el-checkbox>
            <el-checkbox label="出租车"></el-checkbox>
            <el-checkbox label="快速拼车"></el-checkbox>
          </el-checkbox-group>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="submitForm">确认呼叫</el-button>
      </div>
    <!-- 数据容器 -->
    <div id="rResult"></div>
  </div>
</template>

<script >
// import AMap from 'AMap' // 引入高德地图
import { listPost } from "@/api/system/passenger";
import BaiduMap from 'vue-baidu-map'
export default {
  name: "Post",
  dicts: ['sys_normal_disable'],
  data() {
    return {
      flag: false,
      mapZoom: 15,
      sugStyle: {
        zIndex: 999
      },
      mapCenter: { lng: 0, lat: 0 },
      mapLocation: {
        index: 0,
        address: '',
        str: '',
        city: '',
        point: {
          lng: 0,
          lat: 0
        }
      },
      // 非单个禁用
      checkList: ['选中且禁用','复选框 A'],
      single: true,
      // 非多个禁用
      multiple: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        postCode: undefined,
        postName: undefined,
        status: undefined
      },
      // 表单参数
      form: {},
    };
  },


  created() {
    this.getList();

  },
  methods: {
    getList() {
      this.loading = true;
      listPost(this.queryParams).then(response => {
        this.postList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        postId: undefined,
        postCode: undefined,
        postName: undefined,
        postSort: 0,
        status: "0",
        remark: undefined
      };
      this.resetForm("form");
    },

    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
  }
};
</script>
<style>
/* 设定地图的大小 */
#allmap {
  height: 600px;
  width: 1000px;
  margin: 0 auto;
}
</style>


